import request from "@/utils/request";

// 查询订单管理列表
export function listOrderManagement(query) {
  return request({
    url: "/service/orderManagement/list",
    method: "get",
    params: query,
  });
}

// 查询订单管理详细
export function getOrderManagement(id) {
  return request({
    url: "/service/orderManagement/" + id,
    method: "get",
  });
}

// 新增订单管理
export function addOrderManagement(data) {
  return request({
    url: "/service/orderManagement",
    method: "post",
    data: data,
  });
}

// 修改订单管理
export function updateOrderManagement(data) {
  return request({
    url: "/service/orderManagement",
    method: "put",
    data: data,
  });
}

// 删除订单管理
export function delOrderManagement(id) {
  return request({
    url: "/service/orderManagement/" + id,
    method: "delete",
  });
}

// 重新分配订单
export function distributionOrderManagement(data) {
  return request({
    url: `/service/orderManagement/distribution/${data?.orderId}`,
    method: "post",
    data,
  });
}
